import React from 'react'
import BusinessLogin from '@/components/business/login'
import BusinessIndex from '@/components/business/index'
import BusinessProfile from '@/components/business/profile'
import BusinessEmail from '@/components/business/email'
import BusinessCoupon from '@/components/business/coupon'
import BusinessAbout from '@/components/business/about'

//构建二级路由结构
const list = [
  {
    path: 'login',
    component: BusinessLogin,
  },
  {
    path: 'index',
    component: BusinessIndex,
  },
  {
    path: 'profile',
    component: BusinessProfile,
  },
  {
    path: 'email',
    component: BusinessEmail,
  },
  {
    path: 'coupon',
    component: BusinessCoupon,
  },
  {
    path: 'about',
    component: BusinessAbout,
  }
]

// 构建父级路由的组件结构
const Layout = () => <React.Router.Outlet />

//构建顶级路由结构
const RouterList = [
  {
    path: '/business', //路由嵌套 父级路由
    component: Layout, //父组件
    children: list, //子路由结构
  }
]

export default RouterList